package com.itsm.xkitsm.liferoot.adapter;

import java.util.List;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import com.itsm.xkitsm.liferoot.R;

public class MybaseAdapter_lvdetail extends BaseAdapter {
	private Context context;
	private List<Info_lvdetail> data;

	public MybaseAdapter_lvdetail(Context context, List<Info_lvdetail> data) {
		super();
		this.context = context;
		this.data = data;
	}

	@Override
	public int getCount() {
		return data.size();
	}

	@Override
	public Object getItem(int arg0) {
		// TODO Auto-generated method stub
		return data.get(arg0);
	}

	@Override
	public long getItemId(int arg0) {
		// TODO Auto-generated method stub
		return arg0;
	}

	@Override
	public View getView(int arg0, View arg1, ViewGroup arg2) {
		View view = LayoutInflater.from(context).inflate(
				R.layout.lv_detailitem, null);
		TextView tv_name = (TextView) view.findViewById(R.id.tv_phone_name);
		TextView tv_number = (TextView) view.findViewById(R.id.tv_phone_number);
		tv_name.setText(data.get(arg0).getName());
		tv_number.setText(data.get(arg0).getNumber());
		return view;
	}

}
